﻿#include "mediaimgsocket.h"

MediaImgSocket::MediaImgSocket(QObject *parent)
{
    is = false;
    connect(this,&QTcpSocket::readyRead,this,[=](){
        auto data = readAll();
        if(!is)
        {
            id = QString(data);
            is = true;
        }
        else
        {
            //向接收者转发数据
            MediaImgServer::getInstance().tranData(data,id);
        }
    });
}

QString MediaImgSocket::getId()
{
    return id;
}
